package Java.com;

import java.io.*;

public class Employee2 {
	public String name;

	// salary 变量仅在Employee类中可见。
	private double salary;

	// name变量在构造函数中指定。
	public Employee2(String empName) {
		name = empName;
	}

	// 为salary变量赋值
	public void setSalary(double empSal) {
		salary = empSal;
	}

	// 此方法打印员工详细信息
	public void printEmp() {
		System.out.println("name：" + name);
		System.out.println("salary：" + salary);
	}

	public static void main(String[] args) {
		Employee2 empOne = new Employee2("Maxsu");
		empOne.setSalary(15999);
		empOne.printEmp();
	}
}
